{% extends "common/default.html" %}
{% block common %}
    <script type="text/javascript">
        function studentDelete(id) {
            if (confirm("确认要删除这条记录吗？")) {
                $.post("../manager/manager_delete", {id: id},
                    function (result) {
                        if (result=="success") {
                            alert("删除成功!");
                            window.location.href = "../manager/student_list";
                        } else {
                            alert("删除失败");
                        }
                    }
                );
            }
        }
    </script>
    <div class="row search">
        <div class="col-md-6">
            <form action="../manager/manager_search" method="post">
                <div class="input-group" style="width: 300px">
                    <input type="text" class="form-control" name="content"
                           placeholder="请输入要查询的用户名...">
                    <span class="input-group-btn">
		        <button class="btn btn-default" type="submit"><span
                        class="glyphicon glyphicon-search"></span>&nbsp;查询</button>
		      </span>
                </div>
            </form>
        </div>
        <div class="col-md-6">
            <button type="button" style="float: right;" class="btn btn-primary"
                    onclick="javascript:window.location.href='../manager/manager_add'">
                添加
            </button>
        </div>
    </div>
    <div>
        <table class="table table-hover  table-bordered table-striped" style="margin-bottom: 0px;">
            <tr>
                <th>序号</th>
                <th>用户名</th>
                <th>密码</th>
                <th>真实姓名</th>
                <th>学号</th>
                <th>专业</th>
                <th>身份证</th>
                <th>操作</th>
            </tr>
            {% for student in datas %}
                <tr>
                    <td>{{ student.id }}</td>
                    <td>{{ student.userName }}</td>
                    <td>{{student.password }}</td>
                    <td>{{student.trueName }}</td>
                    <td>{{student.stuNo }}</td>
                    <td>{{student.professional }}</td>
                    <td>{{ student.idcard }}</td>
                    <td>
                        <button type="button" class="btn btn-danger btn-xs" onclick="studentDelete({{student.id }})">删除
                        </button>
                    </td>
                </tr>
            {% endfor %}
        </table>
        <nav>
            <ul class="pagination">

            </ul>
        </nav>
    </div>
{% endblock %}



